<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //new 构造函数
        // 构造函数名首字母大写
        // 构造函数不需要return就可以返回
        function Snam(name,age,sex){
            this.name=name;
            this.age=age;
            this.sex=sex;

        }
      var hug =new Snam('胡歌',40,'男');
      console.log(hug);
      var pyy =new Snam('彭于晏',40,'男')
      console.log(pyy);
    </script>
</body>
</html>